﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using log4net;
using log4net.Config;

namespace ElectronicsMarket.InternalService
{
    public class LogService
    {
        private static readonly ILog logger = LogManager.GetLogger(typeof(LogService));

        static LogService()
        {
            BasicConfigurator.Configure();
            XmlConfigurator.Configure();
        }

        public static void WriteLog(int logLevel, string log)
        {
            if (logLevel.Equals(1))
                logger.Debug(log);
            else if (logLevel.Equals(2))
                logger.Error(log);
            else if (logLevel.Equals(3))
                logger.Fatal(log);
            else if (logLevel.Equals(4))
                logger.Info(log);
            else if (logLevel.Equals(5))
                logger.Warn(log);
        }
    }
}